package com.igoal.configuration;

import java.util.ArrayList;
import java.util.List;

import com.igoal.entity.ActionTypeEnum;
import com.igoal.entity.ComponentEnum;

public class LikeConfiguration {

	private static List<ComponentEnum> supportedComponents = new ArrayList<ComponentEnum>();
	private static List<ActionTypeEnum> supportedActions = new ArrayList<ActionTypeEnum>();

	static {
		supportedComponents.add(ComponentEnum.GOAL);
		supportedComponents.add(ComponentEnum.GOAL_ENTRY);
		supportedComponents.add(ComponentEnum.DONE_ENTRY);
		supportedComponents.add(ComponentEnum.USER_STATUS);
		supportedComponents.add(ComponentEnum.USER_THOUGHT);
		supportedComponents.add(ComponentEnum.FRIEND);

		supportedActions.add(ActionTypeEnum.NEW);
		supportedActions.add(ActionTypeEnum.UPDATE);
		supportedActions.add(ActionTypeEnum.FINISH_GOAL);
		supportedActions.add(ActionTypeEnum.BE_FRIEND_WITH);
		supportedActions.add(ActionTypeEnum.REGISTER);
	}

	public static boolean isLikeSupported(ComponentEnum component, ActionTypeEnum action) {
		return supportedComponents.contains(component) && supportedActions.contains(action);
	}

	public static boolean isLikeOnActivity(ComponentEnum component) {
		if (ComponentEnum.GOAL.equals(component) || ComponentEnum.FRIEND.equals(component)) {
			return true;
		}
		return false;
	}

}
